package com.yaodian100.ec.member.service;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Properties;

import com.yaodian100.core.common.dao.impl.CommonCriteria;
import com.yaodian100.core.common.entity.SimplePager;
import com.yaodian100.core.common.exception.CoreException;
import com.yaodian100.core.common.service.DomainService;
import com.yaodian100.ec.member.entity.AddressBook;
import com.yaodian100.ec.member.entity.Balance;
import com.yaodian100.ec.member.entity.BlackBook;
import com.yaodian100.ec.member.entity.BlackBookImportResult;
import com.yaodian100.ec.member.entity.BlackList;
import com.yaodian100.ec.member.entity.Bonus;
import com.yaodian100.ec.member.entity.ImageValid;
import com.yaodian100.ec.member.entity.LoginHistory;
import com.yaodian100.ec.member.entity.Member;
import com.yaodian100.ec.member.entity.MemberMemo;
import com.yaodian100.ec.member.entity.MemberProfile;
import com.yaodian100.ec.member.entity.ViewWishList;
import com.yaodian100.ec.member.entity.VirtualBalance;
import com.yaodian100.ec.member.entity.WishList;
import com.yaodian100.ec.memberevent.entity.MemberEvent;
import com.yaodian100.ec.memberevent.entity.MemberGift;

/**
 * @author feeling.wang
 * 
 */
public interface MemberService extends DomainService<Member> {
	/**
	 * check active data
	 * 
	 * @param memberId
	 * @param activeToken
	 * @return
	 * @throws CoreException
	 */
	public Member checkActivateData(String memberId, String activeToken) throws CoreException;

	/**
	 * 检查是否有新增新复的地址簿资料
	 * 
	 * @param addressBook
	 * @return
	 * @throws CoreException
	 */
	public boolean checkAddressBookExist(AddressBook addressBook) throws CoreException;

	/**
	 * 检查黑名单 by apple.chang
	 * 
	 * @param loginId
	 * @return
	 * @throws CoreException
	 */
	public Member checkLoginData(String loginId) throws CoreException;

	/**
	 * 检查是否有新增重複的收藏夾资料
	 * 
	 * @param wishlist
	 * @return
	 * @throws CoreException
	 */
	public boolean checkWishListExist(WishList wishlist) throws CoreException;

	/**
	 * 刪除地址簿
	 * 
	 * @param id
	 * @return
	 * @throws CoreException
	 */
	public boolean deleteAddressBook(Long id) throws CoreException;

	/**
	 * 删除登入历史记录
	 * 
	 * @param loginId
	 * @throws CoreException
	 */
	public void deleteLoginHistory(String loginId) throws CoreException;

	/**
	 * 單筆/整批修改
	 * 
	 * @param wishListsId
	 * @return
	 * @throws CoreException
	 */
	public boolean deleteWishList(String[] wishListsId) throws CoreException;

	/**
	 * 依id查詢黑名單資料
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public AddressBook getAddressBook(Long id) throws CoreException;

	/**
	 * 依條件查詢地址簿资料
	 * 
	 * @param crit
	 * @return
	 * @throws CoreException
	 */
	public List<AddressBook> getAddressBookList(CommonCriteria crit) throws CoreException;

	// =========================== Bonus Start ===========================
	/**
	 * 取得可使用的购物金
	 * 
	 * @param memberId
	 * @param useBonus
	 * @return
	 * @throws Exception
	 */
	public ArrayList<String> getAvailableBonus(String memberId, BigDecimal useBonus) throws Exception;

	/**
	 * 依会员编号取得Balance资料
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public Balance getBalance(String memberId) throws CoreException;

	/**
	 * 取得黑名單資料
	 * 
	 * @param blackListId
	 * @return
	 * @throws CoreException
	 */
	public BlackList getBlackList(int blackListId) throws CoreException;

	/**
	 * 依查詢條件取得黑名單資料
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public List<BlackList> getBlackLists(CommonCriteria crit) throws CoreException;

	/**
	 * 依id查询购物金资料
	 * 
	 * @param id
	 * @return
	 * @throws CoreException
	 */
	public Bonus getBonus(Long id) throws CoreException;

	/**
	 * 依查询条件取得购物金资料
	 * 
	 * @param crit
	 * @return
	 * @throws CoreException
	 */
	public List<Bonus> getBonusList(CommonCriteria crit, String[] sortBonus) throws CoreException;

	/**
	 * 忘记密码
	 * 
	 * @param loginId
	 * @param email
	 * @return
	 * @throws CoreException
	 */
	public Member getFtMemberPwd(String loginId, String email) throws CoreException;

	/**
	 * 依memberId找寻最近到期且还有馀额的bonus资料
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public String getLastExpireBonus(String memberId) throws CoreException;

	/**
	 * 取得上次登入記錄
	 * 
	 * @param loginId
	 * @return
	 * @throws CoreException
	 */
	public LoginHistory getLastLoginHistory(String loginId) throws CoreException;

	/**
	 * 依會員登入帳號及日期區間查詢longhistory次數
	 * 
	 * @param loginId
	 * @param startLoginTime
	 * @param endLoginTime
	 * @return
	 * @throws CoreException
	 */
	public int getLoginHistorySize(String loginId, Date startLoginTime, Date endLoginTime) throws CoreException;

	/**
	 * 使用email登入
	 * 
	 * @param email
	 * @return
	 * @throws CoreException
	 */
	public Member getMemberByEmail(String email) throws CoreException;

	// =========================== Member Start ===========================
	/**
	 * 依logind查询会员资料
	 * 
	 * @param loginId
	 * @return
	 * @throws CoreException
	 */
	public Member getMemberByLoginId(String loginId) throws CoreException;

	/**
	 * 依條件查詢追蹤清單
	 * 
	 * @param crit
	 * @return
	 * @throws CoreException
	 */
	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yaodian100.core.common.service.DomainService#getList(int, int,
	 * com.yaodian100.core.common.dao.impl.CommonCriteria, java.lang.String[])
	 */
	public List<ViewWishList> getViewWishLists(int firstResult, int maxResults, CommonCriteria criteria,
			String[] sortOrder) throws CoreException;

	public Number getViewWishListSize(CommonCriteria criteria) throws CoreException;

	// =========================== VirtualBalance Start ===========================
	/**
	 * 依会员编号取得全部账户余额资料
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public List<VirtualBalance> getVirtualBalance(String memberId) throws CoreException;

	/**
	 * 依会员编号取得全部礼品卡馀额资料
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public List<VirtualBalance> getGiftcardBalance(String memberId) throws CoreException;

	/**
	 * 依会员编号取得分頁礼品卡馀额资料
	 * 
	 * @param memberId
	 * @param pager
	 * @return
	 * @throws CoreException
	 */
	public List<VirtualBalance> getGiftcardBalanceByPage(String memberId, SimplePager pager) throws Exception;

	/**
	 * 依会员编号取得全部礼品卡總筆數
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public long getGiftcardBalanceSize(String memberId) throws Exception;

	/**
	 * 依查询条件取得账户余额资料
	 * 
	 * @param firstResult
	 * @param maxResults
	 * @param criteria
	 * @param sortOrder
	 * @return
	 * @throws CoreException
	 */
	public List<VirtualBalance> getVirtualBalanceList(int firstResult, int maxResults, CommonCriteria criteria,
			String[] sortOrder) throws CoreException;

	/**
	 * 依查询条件取得账户余额笔数
	 * 
	 * @param criteria
	 * @return
	 * @throws CoreException
	 */
	public Number getVirtualBalanceSize(CommonCriteria criteria) throws CoreException;

	/**
	 * 依memberId计算未生效的bonus
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public String getWaitStartBonus(String memberId) throws CoreException;

	/**
	 * 由id取得wishlist資料
	 * 
	 * @param id
	 * @return
	 * @throws CoreException
	 */
	public WishList getWishList(Serializable id) throws CoreException;

	/**
	 * 依memberId查詢該帳號是否啟用
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public boolean isActived(String memberId) throws CoreException;

	/**
	 * 验证是否有重复的email
	 * 
	 * @param email
	 * @return
	 * @throws CoreException
	 */
	public boolean isEmailExist(String email) throws CoreException;

	public boolean isImageValid(ImageValid imageValid) throws CoreException;

	/**
	 * 验证是否有重复的帐号
	 * 
	 * @param loginId
	 * @return
	 * @throws CoreException
	 */
	public boolean isLoginExist(String loginId) throws CoreException;

	/**
	 * 会员登入
	 * 
	 * @param properties
	 * @return
	 * @throws CoreException
	 */
	public Member login(Properties properties) throws CoreException;

	/**
	 * 会员登入2 by apple.chang
	 * 
	 * @param properties
	 * @return
	 * @throws CoreException
	 */
	public Member loginPwdCheck(String pwd, Member member) throws CoreException;

	// =========================== BlackList Start ===========================
	/**
	 * 黑名單快速解鎖
	 * 
	 * @param entity
	 * @return
	 * @throws CoreException
	 */
	public BlackList quickUnLock(BlackList blackList) throws CoreException;

	/**
	 * 重新计算balance内购物金资料
	 * 
	 * @param memberId
	 * @return
	 * @throws Exception
	 */
	public Balance reCalculateBalance(String memberId) throws Exception;

	/**
	 * 重新發送激活信 (mail & pwd 為 null 時視為不修改mail)
	 * 
	 * @param loginId
	 * @param mail
	 * @param password
	 * @return
	 * @throws CoreException
	 */
	public String resendRegActivateMail(Member member, String mail, String password) throws CoreException;

	/**
	 * 訂單取消，退回購物金
	 * 
	 * @param returnBonus
	 * @return
	 * @throws Exception
	 */
	public boolean returnBonus(ArrayList<Map> returnBonus) throws Exception;

	public boolean returnBonus(ArrayList<Map> returnBonus, String orderId) throws Exception;

	// =========================== AddressBook Start ===========================
	/**
	 * 新增地址簿
	 * 
	 * @param addressBook
	 * @return
	 * @throws CoreException
	 */
	public AddressBook saveAddressBook(AddressBook addressBook) throws CoreException;

	/**
	 * 新增黑名單鎖定
	 * 
	 * @param blackList
	 * @return
	 * @throws CoreException
	 */
	public BlackList saveBlackList(BlackList blackList) throws CoreException;

	/**
	 * 新增前台登入锁定黑名单
	 * 
	 * @param loginId
	 * @return
	 * @throws CoreException
	 */
	public BlackList saveFrontendLoginBlackList(String loginId) throws CoreException;

	/**
	 * 新增前台登入记录(登入成功)
	 * 
	 * @param loginId
	 * @return
	 * @throws CoreException
	 * @throws ParseException
	 */
	public LoginHistory saveFrontendLoginHistory(Member member, String clientIp) throws CoreException, ParseException;

	/**
	 * 新增前台登入记录
	 * 
	 * @param loginId
	 * @param type 0:登入成功 1:验证码错误 2:密码错误
	 * @return
	 * @throws CoreException
	 * @throws ParseException
	 */
	public LoginHistory saveFrontendLoginHistory(Member member, String clientIp, String isSuccess) throws CoreException,
			ParseException;

	public ImageValid saveImageValid(ImageValid imageValid) throws CoreException;

	// =========================== LoginHistory Start ===========================
	/**
	 * 新增login記錄
	 * 
	 * @param loginHistory
	 * @return
	 * @throws CoreException
	 */
	public LoginHistory saveLoginHistory(LoginHistory loginHistory) throws CoreException;

	/**
	 * 新增会员资料
	 * 
	 * @param entity
	 * @return
	 * @throws CoreException
	 */
	public Member saveMember(Member entity) throws CoreException;

	public Member saveMember(Member entity, boolean encodePwd) throws CoreException;

	// =========================== Balance Start ===========================
	/**
	 * 修改会员购物金/coupon/礼品卡资料
	 * 
	 * @param balance
	 * @return
	 * @throws CoreException
	 */
	public Balance saveOrUpdateBalance(Balance balance) throws CoreException;

	/**
	 * 新增/修改购物金资料
	 * 
	 * @param bonus
	 * @return
	 * @throws Exception
	 */
	public Bonus saveOrUpdateBonus(Bonus bonus) throws Exception;

	/**
	 * 批次新增修改购物金资料
	 * 
	 * @param bonusList
	 * @return
	 * @throws Exception
	 */
	public boolean saveOrUpdateBonusBatch(List<Bonus> bonusList) throws Exception;

	/**
	 * 新增/修改账户余额资料
	 * 
	 * @param virtualBalance
	 * @return
	 * @throws CoreException
	 */
	public VirtualBalance saveOrUpdateVirtualBalance(VirtualBalance virtualBalance) throws Exception;

	// =========================== WishList Start ===========================
	/**
	 * 新增追踪清单(单笔)
	 * 
	 * @param wishList
	 * @return
	 * @throws CoreException
	 */
	public WishList saveWishList(WishList wishList) throws CoreException;

	/**
	 * 修改会员密码
	 * 
	 * @param loginId
	 * @param newPwd
	 * @return
	 * @throws CoreException
	 */
	;

	/**
	 * 發送忘記密碼-修改密碼成功通知信函
	 * 
	 * @param loginId
	 * @throws CoreException
	 */
	public void sendForgetPwdModifyOkMail(String loginId, String ccode) throws CoreException;

	/**
	 * 修改mail認證信
	 * 
	 * @param member
	 * @param mail
	 * @param password
	 * @return
	 * @throws CoreException
	 */
	public String sendModifyActivateMail(String loginId, String mail, String password) throws CoreException;

	/**
	 * 發送修改密碼成功通知信函
	 * 
	 * @param loginId
	 * @throws CoreException
	 */
	public void sendModifyPwdOkMail(String loginId) throws CoreException;

	/**
	 * 帳號啟動
	 * 
	 * @param memberId
	 * @param activeToken
	 * @return
	 */
	public Member setMemberActive(String memberId, String activeToken) throws CoreException;

	/**
	 * 修改地址簿
	 * 
	 * @param addressBook
	 * @return
	 * @throws CoreException
	 */
	public AddressBook updateAddressBook(AddressBook addressBook) throws CoreException;

	/**
	 * 修改黑名單鎖定
	 * 
	 * @param blackList
	 * @return
	 * @throws CoreException
	 */
	public BlackList updateBlackList(BlackList blackList) throws CoreException;

	/**
	 * 修改会员资料
	 * 
	 * @param entity
	 * @return
	 * @throws CoreException
	 */
	public Member updateMember(Member entity) throws CoreException;

	/**
	 * 激活成功, 更新e-mail
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 */
	public Member updateMemberEmail(String memberId) throws CoreException;

	public Member updateMemberPwd(String loginId, String newPwd) throws CoreException;

	/**
	 * 修改踨清单
	 * 
	 * @param memberId
	 * @param updWishLists
	 * @param delWishLists
	 * @return
	 * @throws CoreException
	 */
	public WishList updateWishList(WishList wishList) throws CoreException;

	/**
	 * 更新电子报订阅状态
	 * 
	 * @param loginId
	 * @param status
	 * @return
	 * @throws CoreException
	 */
	public Member updateEDMStatus(String loginId, String edm_status, String sms_status) throws CoreException;

	/**
	 * 檢查密碼
	 * 
	 * @param pwd
	 * @param member
	 * @return
	 * @throws CoreException
	 */
	public boolean pwdCheck(String pwd, Member member) throws CoreException;

	/**
	 * 移除未激活会员
	 */
	public void removeOverdueMember();

	/**
	 * 储存手机认证会员
	 * 
	 * @param entity
	 * @return
	 * @throws CoreException
	 */
	public Member saveMobileMember(Member entity) throws CoreException;

	public Member saveMobileMember(Member entity, boolean encodePwd) throws CoreException;

	/**
	 * 检查手机是否已被注册
	 * 
	 * @param mobile
	 * @return
	 * @throws CoreException
	 */
	public boolean isMobileExist(String mobile, Member member) throws CoreException;

	/**
	 * 重新发送激活简讯
	 * 
	 * @param member
	 * @param mobile
	 * @return
	 * @throws CoreException
	 */
	public String resendRegActivateSMS(Member member, String mobile) throws CoreException;

	/**
	 * 手机激活
	 * 
	 * @param loginId
	 * @param ccode
	 * @return
	 * @throws CoreException
	 */
	public Member setMobileMemberActive(String loginId, String ccode) throws CoreException;

	/**
	 * 
	 * @param mobile
	 * @return
	 * @throws CoreException
	 */
	public Member getMemberByMobile(String mobile) throws CoreException;

	/**
	 * 检查手机忘记密码次数
	 * 
	 * @param member
	 * @return
	 * @throws CoreException
	 */
	public Member checkMobileForgetPwdCount(Member member) throws CoreException;

	/**
	 * 发送手机找回密码简讯&邮件
	 * 
	 * @param member
	 * @param mobile
	 * @return
	 * @throws CoreException
	 */
	public Member getFtMemberPwdmobile(Member member, String mobile) throws CoreException;

	/**
	 * 检查手机修改次数, 如换月counter归0
	 * 
	 * @param member
	 * @return
	 * @throws CoreException
	 */
	public Member checkMobileModifyCount(Member member) throws CoreException;

	/**
	 * 寄送修改手机校验码简讯 & email
	 * 
	 * @param member
	 * @param mobile
	 * @param password
	 * @return
	 * @throws CoreException
	 */
	public String sendModifyMobileActivateSms(Member member, String mobile, String password, boolean needPwd)
			throws CoreException;

	/**
	 * 更新手机号码
	 * 
	 * @param member
	 * @return
	 * @throws CoreException
	 */
	public Member setModifyMobileActive(Member member) throws CoreException;

	/**
	 * 更新未支付訂單數
	 * 
	 * @param memberId
	 * @return
	 * @throws CoreException
	 * @throws ParseException
	 */
	public Balance updateOrder2PayBalance(String memberId);

	/**
	 * 发送删除手机号码验证简讯
	 * 
	 * @param member
	 * @param password
	 * @return
	 * @throws CoreException
	 */
	public String sendDeleteMobileActivateSms(Member member, String password) throws CoreException;

	/**
	 * 删除手机号码
	 * 
	 * @param member
	 * @return
	 * @throws CoreException
	 */
	public Member deleteMobile(Member member) throws CoreException;

	/**
	 * 取得MemberGift
	 * 
	 * @param member
	 * @return
	 * @throws CoreException
	 */
	public MemberGift getMemberGift(Member member) throws CoreException;

	/**
	 * 取得MemberEvent
	 * 
	 * @param member
	 * @return
	 * @throws CoreException
	 */
	public MemberEvent getMemberEvent(Member member) throws CoreException;

	public Member getMemberByLoginId(String loginId, String domainSrc) throws CoreException;

	public Balance newBalance(Member member);

	public void checkBalance(Member member) throws Exception;

	public Member saveNonMember(Member entity) throws CoreException;

	/**
	 * 检查会员是否填写过问卷
	 * 
	 * @param memberId
	 * @param surveyId
	 * @return
	 * @throws CoreException
	 */
	public boolean isJoined(String memberId, String surveyId) throws CoreException;

	public MemberProfile getMemberProfile(String memberId) throws CoreException;

	public boolean saveSurveyData(Member member, MemberMemo memberMemo, MemberProfile memberProfile) throws CoreException;

	public WishList getWishList(WishList wishlist) throws CoreException;

	/**
	 * 补货通知
	 * 
	 * @return
	 */
	public boolean sendRestockRemindEmail();

	/**
	 * 补货通知 - 商品删除通知
	 * 
	 * @return
	 */
	public boolean sendRestockRemindDeleteEmail();

	/**
	 * 發送被設定補貨通知的缺貨商品 to pm
	 * 
	 * @return
	 */
	public boolean sendRestockRemindPMEmail();

	/**
	 * 取得條件符合的地址簿
	 * 
	 * @param id
	 * @param type
	 * @param fromProvince
	 * @param fromCity
	 * @param fromDistrict
	 * @return
	 * @throws CoreException
	 */
	public List<AddressBook> getCanUseAddressBook(String id, String type, String fromProvince, String fromCity,
			String fromDistrict) throws CoreException;

	public List<AddressBook> getCanUseAddressBook(String id, String type, String fromProvince, String fromCity,
			String fromDistrict, boolean prodVolume) throws CoreException;

	public List<AddressBook> getAddressBookList(String memberId) throws CoreException;

	public List<AddressBook> getCanUseAddressBook(String id, String type, String fromProvince, String fromCity,
			String fromDistrict, String paymentType) throws CoreException;

	public List<AddressBook> getCanUseAddressBook(String id, String type, String fromProvince, String fromCity,
			String fromDistrict, String paymentType, boolean prodVolumn) throws CoreException;

	public VirtualBalance updateVirtualBalanceDate(String trxTypeId, String memberId, Date date);

	/**
	 * 信任登入送购物金or礼卷用
	 * 
	 * @param member
	 * @return
	 * @throws CoreException
	 */
	public MemberEvent checkMemberEvent(Member member) throws CoreException;

	/**
	 * 收货人地址/电话黑名单
	 * 
	 * @param productId[],cost[]
	 * @return
	 */
	public String receiverBlackBookArray(String[] blockType, String[] blockContent) throws CoreException;

	/**
	 * 灰名单
	 * 
	 * @param memberId[]
	 * @return
	 */
	public String greykBookArray(String[] memberId) throws CoreException;

	/**
	 * 新增非立即生效的购物金
	 * 
	 * @param bonus
	 * @return
	 * @throws Exception
	 */
	public Bonus saveOrUpdateBonusNotRecalculate(Bonus bonus);

	/**
	 * 灰名单升级黑名单
	 * 
	 * @param memberId[]
	 * @return
	 */
	public String greyToBlackBook() throws CoreException;

	/**
	 * 惡意訂單－訂單處理審核。
	 * 
	 * @param memberId[]
	 * @return
	 */
	public String badOrderCheck(String memberId, String receiverAdd, String receiverMobile, String receiverPhone)
			throws CoreException;

	/**
	 * 依會員 id 新增異常名單。如果該 memberi id 的會員已經有存在的異常名單且狀態為鎖定，就不不允许重覆加入。
	 * 
	 * @param memberId
	 * @return 新產生的異常名單
	 */
	public BlackBook addBlackBookByMemberId(BlackBook blackBook);

	/**
	 * 依異常名單 id 解除異常名單。
	 * 
	 * @param blackBookId
	 * @return 解除後的異常名單
	 */
	public BlackBook unblockBlackBookByBlackBookId(Integer blackBookId);

	/**
	 * 依傳入的異常名單物件解除鎖定。
	 * 
	 * @param blackBook
	 * @return 解除後的異常名單
	 */
	public BlackBook unblockBlackBook(BlackBook blackBook);

	/**
	 * 依 member id 判斷是否可以新增異常記錄
	 * 
	 * @param memberId
	 * @return 該 member id 的會員是否可以新增異常記錄
	 */
	public boolean isBlackBookAddableByMemberId(String memberId);

	/**
	 * 匯入異常名單
	 * 
	 * @param file
	 * @return 匯入結果
	 */
	public BlackBookImportResult importBlackBookList(File file) throws FileNotFoundException, IOException;

	/**
	 * 依 member id 查詢異常記錄
	 * 
	 * @param memberId
	 * @return 異常記錄列表
	 */
	public List<BlackBook> getBlackBookListByMemberId(String memberId);

	/**
	 * 依 member id 查詢異常記錄
	 * 
	 * @param aMemberId
	 * @return 異常說明，若正常回傳true
	 */
	public String badMemberCheck(String aMemberId);

	/**
	 * 清除手机验证限制
	 * 
	 * @param memberId
	 * @param type 1:清除手机验证日期 2:清除手机验证次数 3:1+2
	 * @return
	 */
	public String clearRegMobileInfo(String memberId, String type);

	/**
	 * 登入成功, 赠送积分
	 * 
	 * @param member
	 * @param loginDomain
	 * @param cookie
	 * @throws ParseException
	 */
	public void checkLoginBonus(Member member, String loginDomain, String cookie) throws ParseException;

	/**
	 * 取消已发放之积分
	 * 
	 * @param cancelAmount
	 * @param orderId
	 * @throws Exception
	 */
	public BigDecimal cancelOrderBonus(BigDecimal cancelAmount, String orderId, String memberId) throws Exception;

	/**
	 * 是否读取过填寫個人信息dialog
	 * 
	 * @param member
	 * @return
	 */
	public String showCompleteInfoDialog(Member member);

	/**
	 * 更新性别&生日
	 * 
	 * @param member
	 * @param sex
	 * @param date
	 * @return
	 * @throws ParseException
	 */
	public Member updateSexAndBirthday(Member member, String sex, String date) throws ParseException;

	/**
	 * 发送积分
	 * 
	 * @param member
	 * @param amount 发送金额
	 * @param description 积分说明
	 * @param trxType default: "EVENT_POINT"
	 * @param startDate default: 立即生效
	 * @param endDate default: 隔年月底
	 * @throws Exception
	 */
	public void giveBonus(String memberId, BigDecimal amount, String description, String trxType, Date startDate,
			Date endDate) throws Exception;
}